<html layout:decorate="~{project/indexManage/target_list}" xmlns:layout="http://www.w3.org/1999/xhtml">
<div layout:fragment="content_list">

    <!--<div class="search_condition">-->
    <!--<form id="search-form">-->
    <!--<input class="search-data" name="Q_LIKE_name" type="text" placeholder="角色名称" >-->
    <!--<select class="search-data" name="Q_EQ_type.id">-->
    <!--<option value="">选择身份</option>-->
    <!--<option th:each="parameter:${parameters}" th:value="${parameter.id}" th:text="${parameter.name}"></option>-->
    <!--</select>-->
    <!--<button type="button" id="search-btn" class="btn btn-primary btn-search" >搜索</button>-->
    <!--</form>-->
    <!--</div>-->

    <div class="main-body">

        <div id="toolbar" class="btn-group btn-group-sm ">

            <a type="button" class="btn btn-primary" data-toggle="modal"
               href="/project/indexManage/index_add" data-target="#modal">新增</a>

            <a type="button" onclick="delDatas('/project/indexManage/index_del')" class="btn btn-danger">删除</a>
            <a type="button" href="/project/indexManage/index_edit" class="btn btn-info" data-toggle="modal"
               data-target="#modal">编辑</a>
            <a type="button" href="/project/indexManage/index_importData" class="btn btn-success" data-toggle="modal"
               data-target="#modal">导入数据</a>
            <a type="button" onclick="" class="btn btn-success">导出数据</a>
        </div>

        <table id="dataTable" data-url="/project/indexManage/index_data" data-page-list=[] data-striped="true"
               data-pagination="true" data-page-size="15" data-cache="false" data-toolbar-align="right"
        >

        </table>

        <script>
            var dataFormat_point = [{
                checkbox: true
            }, {
                field: 'id',
                title: 'id',
                visible: false
            }, {
                field: 'code',
                title: '编号',
                sortable: true
            }, {
                field: 'name',
                title: '名称',
                sortable: true
            }, {
                field: 'objName',
                title: '适用对象',
                sortable: true,
                formatter: function (value, row, index) {
                    if (value == 1011) {
                        return '项目';
                    }
                    if (value == 1012) {
                        return '变流器';
                    }
                    if (value == 1013) {
                        return '电池包';
                    }
                    if (value == 1014) {
                        return '电池模组';
                    }
                    if (value == 1015) {
                        return '电池单体';
                    }
                    if (value == 1016) {
                        return '平台';
                    }
                }
            }, {
                field: 'objType',
                title: '所属类别',
                sortable: true,
                formatter: function (value, row, index) {
                    if (value == 1031) {
                        return '电压';
                    }
                    if (value == 1032) {
                        return 'SOC';
                    }
                    if (value == 1033) {
                        return '温度';
                    }
                    if (value == 1034) {
                        return '其他';
                    }
                }
            }, {
                field: 'propertyType',
                title: '类型',
                sortable: true,
                formatter: function (value, row, index) {
                    if (value == 1001) {
                        return '整型';
                    }
                    if (value == 1002) {
                        return '浮点型';
                    }
                }
            }, {
                field: 'unit',
                title: '单位',
                sortable: true
            }, {
                field: 'source',
                title: '来源',
                sortable: true,
                formatter: function (value, row, index) {
                    if (value == 1021) {
                        return '计算';
                    }
                    if (value == 1022) {
                        return '诊断';
                    }
                    if (value == 1023) {
                        return '通信';
                    }
                }
            }, {
                field: 'isShow',
                title: '是否展示',
                sortable: true,
                formatter: function (value, row, index) {
                    if (value == 1) {
                        return '<input type="checkbox" checked>';
                    }
                }
            }];

            window.onload = function () {
                getTable(dataFormat_point, "dataTable");
            };

        </script>
    </div>
</div>
</html>

